<script language='javascript'>
// JavaScript Document
function css3(){
	$("input[@type='text'], input[@type='password'],textarea").addClass('input_onFocus');
};
$(function(){
	css3();
	$("#form1").validate({
		debug :true,
		success: function(label) {
			label.html("正确!").addClass("right");
		},
		errorClass: "wrong",
		rules: {
			txtloginname: {required:true,minLength:5,maxLength:20},
			txtpassword: {required:true,minLength:6,maxLength:16},
			txtcheckpassword: {required:true,minLength:6,maxLength:16,equalTo:'#txtpassword'},
			txtemail: {required:true,email:true},
			txtecheckmail: {required:true,email:true,equalTo:'#txtemail'},
			code: {required:true}
		},
		messages: {
			txtloginname: {required: "用户名不能为空!",minLength: "用户名长度至少是5位!",maxLength: "用户名长度最长是20位!"},
			txtpassword: {required: "密码不能为空!",minLength: "密码长度至少是4位!",maxLength: "密码长度最长是16位!"},
			txtcheckpassword: {required: "重复密码不能为空!",minLength: "重复密码长度至少是4位!",	maxLength: "重复密码长度最长是16位!",equalTo:"两次输入的密码不相同！"},
			txtemail: {required: "请email地址不能为空!",email: "请输入正确格式的email!"},
			txtecheckmail: {required: "请email地址不能为空!",email: "请输入正确格式的email!",equalTo:"两次输入的邮箱地址不相同！"},
			code: {required: "验证码不能为空!"}
		}
	});
	$('table.bb tr td input[@type="text"]').focus(function() { $(this).parent().next().find('label').addClass('label_focus') }).blur(function() { $(this).parent().next().find('label').removeClass('label_focus') });
//alert();

})
</script>
